package com.mzj.saas.config.face;

import com.aliyuncs.DefaultAcsClient;
import com.aliyuncs.IAcsClient;
import com.aliyuncs.profile.DefaultProfile;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 阿里云-人脸比对
 * @author shun
 * @createDate: 2021年9月27日 下午6:26:53
 * @version: 1.0
 *
 */
@Configuration
public class FaceConfig {
	/**
	 * access
	 */
	@Value("${ali.face.accessKeyId}")
	private String accessKeyId;
	@Value("${ali.face.accessKeySecret}")
	private String accessKeySecret;
	/**
	 * 比对相似度
	 */
	@Value("${ali.face.confidence}")
	private Float confidence;

	/**
	 * 客户端
	 * 
	 * @return
	 * @author shun
	 * @date 2021年3月23日
	 */
	@Bean
	public IAcsClient IAcsClient() {
		DefaultProfile profile = DefaultProfile.getProfile("cn-shanghai", // 默认
				accessKeyId, // 您的AccessKeyID
				accessKeySecret); // 您的AccessKeySecret

		return new DefaultAcsClient(profile);
	}

	public String getAccessKeyId() {
		return accessKeyId;
	}

	public void setAccessKeyId(String accessKeyId) {
		this.accessKeyId = accessKeyId;
	}

	public String getAccessKeySecret() {
		return accessKeySecret;
	}

	public void setAccessKeySecret(String accessKeySecret) {
		this.accessKeySecret = accessKeySecret;
	}

	public Float getConfidence() {
		return confidence;
	}

	public void setConfidence(Float confidence) {
		this.confidence = confidence;
	}

}